import {
  PrimaryGeneratedColumn,
  CreateDateColumn,
  UpdateDateColumn,
  OneToOne,
  JoinColumn
} from 'typeorm'
import { EntityModel } from '@midwayjs/orm'

import { User } from './user'

@EntityModel('user_meta')
export class UserMeta {
  
  @PrimaryGeneratedColumn()
  id: number;

  @OneToOne(() => User, { nullable: false })
  @JoinColumn({ name: 'user_id' })
  user: User;

  @CreateDateColumn({
    comment: '创建时间'
  })
  create_at: Date;

  @UpdateDateColumn({
    comment: '更新时间'
  })
  update_at: Date;
}
